#include "Poker.h"
#include <cstdio>

Poker::Poker() {
}

Poker::Poker(Value value, Suit suit) {
  this->value = value;
  this->suit = suit;
}

bool Poker::operator < (const Poker & poker) const {
  return this->value < poker.value;
}

bool Poker::operator > (const Poker & poker) const {
  return this->value > poker.value;
}

string Poker::toString() {
  if (value > NINE) {
    switch(value) {
      case TEN:
        return "T";
      case JACK:
        return "J";
      case QUEEN:
        return "Q";
      case KING:
        return "K";
      case ACE:
        return "A";
      default:
        return "";
    }
  } else {
    char buf[2];
    sprintf(buf, "%d", (int)value);
    return buf;
  }
}
